package com.ucl.web.controller.system;


import com.baomidou.mybatisplus.plugins.Page;
import com.ucl.model.common.ApiResult;
import com.ucl.model.entity.system.SysDict;
import com.ucl.model.request.base.BasePageQuery;
import com.ucl.service.system.SysDictService;
import com.ucl.web.controller.base.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wqc
 * @since 2020-06-22
 */
@RestController
@RequestMapping("/api/system/dict")
@Api(description = "系统管理 - 字典表接口")
public class SysDictController extends BaseController {

    @Autowired
    SysDictService sysDictService;

    @PostMapping(value = "/selectPage", produces = "application/json;charset=utf-8")
    @ApiOperation(value = "获取系统管理 - 字典表列表分页", httpMethod = "POST", response = ApiResult.class)
    public ApiResult listPage(@RequestBody BasePageQuery filter) {
        Page<SysDict> page = new Page<>(filter.getPage(),filter.getLimit());
        sysDictService.selectPage(page);
        return ApiResult.ok("获取系统管理 - 字典表列表分页成功", page);
    }
}
